package cn.iocoder.yudao.module.lowcode.controller.admin.script.vo;

import cn.iocoder.yudao.framework.common.validation.InEnum;
import cn.iocoder.yudao.module.lowcode.enums.GroovyScriptStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import javax.validation.constraints.*;

@Schema(description = "管理后台 - Groovy 脚本更新 Request VO")
@Data
public class GroovyScriptUpdateReqVO {

    @Schema(description = "脚本编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
    @NotNull(message = "脚本编号不能为空")
    private Long id;

    @Schema(description = "脚本名称/唯一标识", example = "test_script")
    @Pattern(regexp = "^[a-zA-Z][a-zA-Z0-9_]*$", message = "脚本名称格式不正确，只能包含字母、数字和下划线，且以字母开头")
    @Size(max = 50, message = "脚本名称长度不能超过50个字符")
    private String scriptName;

    @Schema(description = "脚本显示名称", example = "测试脚本")
    @Size(max = 100, message = "脚本显示名称长度不能超过100个字符")
    private String displayName;

    @Schema(description = "脚本内容")
    @Size(max = 65535, message = "脚本内容长度不能超过65535个字符")
    private String scriptContent;

    @Schema(description = "脚本描述", example = "这是一个测试脚本")
    @Size(max = 500, message = "脚本描述长度不能超过500个字符")
    private String description;

    @Schema(description = "脚本状态", example = "1")
    @InEnum(GroovyScriptStatusEnum.class)
    private Integer status;

    @Schema(description = "脚本分类/标签", example = "business")
    @Size(max = 50, message = "脚本分类长度不能超过50个字符")
    private String category;

    @Schema(description = "排序", example = "1")
    @Min(value = 0, message = "排序必须大于等于0")
    private Integer sort;

}